package day07Test;

import java.util.Random;

public class Test3 {
    //随机验证码
    public static void main(String[] args) {
        char[] chs = new char[52];
        for (int i = 0; i < chs.length; i++) {
            if (i < 26){
                chs[i] = (char) (97 + i);
            }else {
                chs[i] = (char) (65 + i -26);
            }
        }
        Random r = new Random();
        String result = "";
        for (int i = 0; i < 4; i++) {
            int randomIndex = r.nextInt(chs.length);
            char a = chs[randomIndex];
            result = result + a;
        }
        int b = r.nextInt(10);
        System.out.print(result + b);

    }
}
